package com.vo;

import com.bean.Films;
import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class FilmsVo implements Serializable {
    private String id;
    private String movieId;
    private String startTime;
    private String stopTime;
    private String cinemaId;
    private String price;
    private String state;
    private String spare;

    public Films parse(){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Films f = new Films();
        try {
            f.setId(Integer.valueOf(this.id));
        } catch (NumberFormatException e) {
        }
        try {
            f.setMovieId(Integer.valueOf(this.movieId));
        } catch (NumberFormatException e) {
        }
        try {
            f.setStartTime(simpleDateFormat.parse(this.startTime));
        } catch (ParseException e) {
        }
        try {
            f.setStopTime(simpleDateFormat.parse(this.stopTime));
        } catch (ParseException e) {

        }
        try {
            f.setCinemaId(Integer.valueOf(this.cinemaId));
        } catch (NumberFormatException e) {

        }
        try {
            f.setPrice(Double.parseDouble(this.price));
        } catch (NumberFormatException e) {

        }
        try {
            f.setState(Integer.valueOf(this.state));
        } catch (NumberFormatException e) {

        }
        try {
            f.setSpare(Integer.valueOf(this.spare));
        } catch (NumberFormatException e) {

        }
        return f;
    }

    public FilmsVo() {
    }

    public FilmsVo(String id) {
        this.id = id;
    }

    public FilmsVo(String movieId, String startTime, String stopTime, String cinemaId, String price, String state, String spare) {
        this.movieId = movieId;
        this.startTime = startTime;
        this.stopTime = stopTime;
        this.cinemaId = cinemaId;
        this.price = price;
        this.state = state;
        this.spare = spare;
    }

    public FilmsVo(String id, String movieId, String startTime, String stopTime, String cinemaId, String price, String state, String spare) {
        this.id = id;
        this.movieId = movieId;
        this.startTime = startTime;
        this.stopTime = stopTime;
        this.cinemaId = cinemaId;
        this.price = price;
        this.state = state;
        this.spare = spare;
    }

    @Override
    public String toString() {
        return "FilmsVo{" +
                "id='" + id + '\'' +
                ", movieId='" + movieId + '\'' +
                ", startTime='" + startTime + '\'' +
                ", stopTime='" + stopTime + '\'' +
                ", cinemaId='" + cinemaId + '\'' +
                ", price='" + price + '\'' +
                ", state='" + state + '\'' +
                ", spare='" + spare + '\'' +
                '}';
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getMovieId() {
        return movieId;
    }

    public void setMovieId(String movieId) {
        this.movieId = movieId;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getStopTime() {
        return stopTime;
    }

    public void setStopTime(String stopTime) {
        this.stopTime = stopTime;
    }

    public String getCinemaId() {
        return cinemaId;
    }

    public void setCinemaId(String cinemaId) {
        this.cinemaId = cinemaId;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getSpare() {
        return spare;
    }

    public void setSpare(String spare) {
        this.spare = spare;
    }
}
